home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / 3D Additions 1.7 / 3D Demo src / C3DDemoWin.cp < prev    next >
Encoding:
Text File  |  1995-01-24  |  2.8 KB  |  104 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    C3DDemoWin.cp
  3. // ===========================================================================
  4.  
  5. #include "C3DDemoWin.h"
  6.  
  7. #include <LStream.h>
  8. #include <UDrawingUtils.h>
  9.  
  10. #include <3DGrays.h>
  11. #include <3DAttachments.h>
  12. #include <3DDrawingUtils.h>
  13.  
  14. // ---------------------------------------------------------------------------
  15. //        • Create3DDemoWinStream [static]
  16. // ---------------------------------------------------------------------------
  17. //    This is the function you register with URegistrar to create a C3DDemoWin
  18. //    window from a resource
  19.  
  20.  
  21. C3DDemoWin *
  22. C3DDemoWin::CreateFromStream(
  23.     LStream *inStream)
  24. {
  25.     return (new C3DDemoWin(inStream));
  26. }
  27.  
  28. // ---------------------------------------------------------------------------
  29. //        • C3DDemoWin
  30. // ---------------------------------------------------------------------------
  31. //    The default constructor does nothing.
  32.  
  33. C3DDemoWin::C3DDemoWin()
  34. {
  35. }
  36.  
  37. // ---------------------------------------------------------------------------
  38. //        • C3DDemoWin
  39. // ---------------------------------------------------------------------------
  40. //    The construct-from-stream constructor just constructs the base class.
  41.  
  42. C3DDemoWin::C3DDemoWin(LStream *inStream)
  43.     : LWindow(inStream)
  44. {
  45. }
  46.  
  47. // ---------------------------------------------------------------------------
  48. //        • ~C3DDemoWin
  49. // ---------------------------------------------------------------------------
  50. //    The default destructor does nothing.
  51.  
  52. C3DDemoWin::~C3DDemoWin()
  53. {
  54. }
  55.  
  56. // ---------------------------------------------------------------------------
  57. //        • FinishCreateSelf
  58. // ---------------------------------------------------------------------------
  59.  
  60. void
  61. C3DDemoWin::FinishCreateSelf()
  62. {
  63.     PenState    thePenState;
  64.     thePenState.pnSize.h = 1;
  65.     thePenState.pnSize.v = 1;
  66.     thePenState.pnMode = srcCopy;
  67.     thePenState.pnPat = qd.black;
  68.  
  69.     AddAttachment(new C3DPanelAttachment(&thePenState));
  70. }
  71.  
  72. // ---------------------------------------------------------------------------
  73. //        • DrawSelf
  74. // ---------------------------------------------------------------------------
  75.  
  76. void
  77. C3DDemoWin::DrawSelf()
  78. {
  79.     U3DDrawingUtils::Draw3DInsetHLine( 190,  40, 200);
  80.     U3DDrawingUtils::Draw3DInsetVLine(  20, 180, 220);
  81.  
  82.     U3DDrawingUtils::Draw3DRaisedHLine( 210,  40, 200);
  83.     U3DDrawingUtils::Draw3DRaisedVLine( 220, 180, 220);
  84.     
  85.     Rect    oval = { 170, 65, 182, 77};
  86.     
  87.     U3DDrawingUtils::Draw3DInsetOvalPanel(&oval);
  88.     
  89.     ::OffsetRect( &oval, 20, 0);
  90.     U3DDrawingUtils::Draw3DRaisedOvalPanel(&oval);
  91.     
  92.     ::OffsetRect( &oval, 20, 0);
  93.     U3DDrawingUtils::Draw3DInsetOvalBorder(&oval);
  94.     
  95.     ::OffsetRect( &oval, 20, 0);
  96.     U3DDrawingUtils::Draw3DRaisedOvalBorder(&oval);
  97.     
  98.     ::OffsetRect( &oval, 20, 0);
  99.     U3DDrawingUtils::Draw3DInsetOvalFrame(&oval);
  100.     
  101.     ::OffsetRect( &oval, 20, 0);
  102.     U3DDrawingUtils::Draw3DRaisedOvalFrame(&oval);
  103. }
  104.